home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / site-packages / psyco / logger.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2006-03-29  |  3KB  |  47 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. '''Psyco logger.
  5.  
  6. See log() in core.py.
  7. '''
  8. import _psyco
  9. from time import time, localtime, strftime
  10. current = None
  11. print_charges = 10
  12. dump_delay = 0.20000000000000001
  13. dump_last = 0.0
  14.  
  15. def write(s, level):
  16.     t = time()
  17.     f = t - int(t)
  18.     current.write('%s.%02d  %-*s%s\n' % (strftime('%X', localtime(int(t))), int(f * 100.0), 63 - level, s, '%' * level))
  19.     current.flush()
  20.  
  21.  
  22. def psycowrite(s):
  23.     t = time()
  24.     f = t - int(t)
  25.     current.write('%s.%02d  %-*s%s\n' % (strftime('%X', localtime(int(t))), int(f * 100.0), 60, s.strip(), '% %'))
  26.     current.flush()
  27.  
  28.  
  29. def writememory():
  30.     write('memory usage: %d+ kb' % _psyco.memory(), 1)
  31.  
  32.  
  33. def dumpcharges():
  34.     global dump_last
  35.     pass
  36.  
  37.  
  38. def writefinalstats():
  39.     dumpcharges()
  40.     writememory()
  41.     writedate('program exit')
  42.  
  43.  
  44. def writedate(msg):
  45.     write('%s, %s' % (msg, strftime('%x')), 20)
  46.  
  47.